<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- .wrap>button{新增}+ul.list>li*6{$$} -->
    <div class="wrap">
        <button class="btn">删除</button>
        <button class="btn">删除</button>
        <ul class="list">
            <li>01</li>
            <li>02</li>
            <li class="mid">03</li>
            <li>04</li>
            <li>05</li>
            <li>06</li>
        </ul>
    </div>
</body>
<script>
    var btn1 = document.getElementsByClassName("btn")[0];
    var btn2 = document.getElementsByClassName("btn")[1];
    var list = document.getElementsByClassName("list")[0];
    var mid = document.getElementsByClassName("mid")[0];

    // 元素删除
    // 自删 
    // Element.remove()   

    // 父删 => 父元素统筹
    // parent.removeChild(node)

    // 点击按钮 删除mid
    btn1.onclick = function () {
        // mid.remove()
        if (mid) {
            mid.remove()
            mid = null;
        }
    }

    btn2.onclick = function () {
        if (mid) {
            list.removeChild(mid);
            mid = null;
        }
    }





</script>

</html>